package com.tujia.controller;

import com.tujia.ProblemType;
import com.tujia.UserInfo;
import com.tujia.domain.CityInfo;
import com.tujia.service.CityInfoService;
import com.tujia.service.ProblemTypeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/test")
public class TestController {
    private final static Logger logger = LoggerFactory.getLogger(TestController.class);
    @Autowired
    ProblemTypeService problemTypeService;
/*    @Autowired
    CityInfoService cityInfoService;

    @RequestMapping("/city")
    @ResponseBody
    public CityInfo getCityInfo(HttpServletRequest request) throws Exception {
        logger.info("TestController日志: {}", "请求城市");
        CityInfo cityList = cityInfoService.getCityList(4);
        logger.info("城市查询结果: {}", cityList);
        System.out.println(cityList);
        return cityList;
    }*/

    @RequestMapping("/problem")
    public ProblemType getProblemInfo() throws Exception {
        logger.info("TestController日志: {}", "请求问题类型!");
        ProblemType problem = problemTypeService.getProblemTypeById(10);
        logger.info("问题类型查询结果: {}", problem);
        System.out.println(problem);
        return problem;
    }
}
